/**
 * 
 */
package neptune.web.server.operations;

import it.robertobifulco.ias.IncorrectParamsException;
import it.robertobifulco.ias.Operation;

import neptune.manager.NeptuneManager;
import neptune.web.server.ApplicationManager;

/**
 * @author Roberto Bifulco [info@robertobifulco.it, robertobifulco.it]
 *
 */
public class ExperimentCreation implements Operation {

	public static String ID = "ExperimentCreation";
	
	/* (non-Javadoc)
	 * @see it.robertobifulco.ias.Operation#execute(java.lang.Object[])
	 */
	/**
	 * @param args[0] = String admin
	 * @param args[1] = String expName
	 * @return null
	 */
	public Object[] execute(Object[] args) throws IncorrectParamsException,
			Exception {
		
		String admin = (String) args[0];
		String expName = (String) args[1];
		
		ApplicationManager manager = ApplicationManager.getApplicationManager();
		NeptuneManager expManager = manager.getNeptuneManager();
		
		expManager.createExperiment(expName, admin);
		
		return null;
	}

	/* (non-Javadoc)
	 * @see it.robertobifulco.ias.Operation#getDescription()
	 */
	public String getDescription() {
		return "Experiment creation operation";
	}

	/* (non-Javadoc)
	 * @see it.robertobifulco.ias.Operation#getID()
	 */
	public String getID() {
		return ID;
	}

}
